# -*- coding: utf-8 -*- 

import sys, os
bp=os.path.dirname(os.environ['PWD'])
print sys.argv[0] , __file__, bp
sys.path.append(bp)

import levin.lib.levinCommon as levinCommon
import gettext
gettext.install('LeVin', levinCommon.LEVIN_PO, unicode=True)


import levin.lib.wineObjects as wineObjects

import levin.lib.wineAreas as wineAreas
import levin.lib.wineObjects as wineObjects
import levin.lib.wineSelector as wineSelector

#DEFAULT_user = 'user.pk'
DEFAULT_user = '/home/delsart/.config/LeVin/user.pk'

wineAreas.loadAll(DEFAULT_user)

def shiftRates(delta):
    delta = int(delta)
    for b in wineAreas.wineWorld.getWines():
        print b.appellation, b.cru_name
        if b.tastings is None:
            continue
        for t in b.tastings:
            print ' --> ',t.rate
            t.rate -=delta
        b.updateRate()
def saveDefault():
    wineAreas.wineWorld.saveUserContent(DEFAULT_user)
